{extend name="admin@public/base_content" /}
{block name="body"}
<body>
{include file="admin@public/common" /}
<div class="container-fluid larry-wrapper">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <section class="panel panel-padding">
                <form id="form1" class="layui-form layui-form-pane" action="{:url('')}">
                    <div class="layui-form-item">
                        <label class="layui-form-label">下拉框</label>
                        <div class="layui-input-inline">
                            <select name="ykb_selected" jq-verify="required" jq-error="请输入" lay-filter="verify">
                                <option value=""></option>
                                <option {eq name="info.ykb_selected" value="1"}selected{/eq} value="1">北京</option>
                                <option {eq name="info.ykb_selected" value="2"}selected{/eq} value="2">上海</option>
                                <option {eq name="info.ykb_selected" value="3"}selected{/eq} value="3">广州</option>
                                <option {eq name="info.ykb_selected" value="4"}selected{/eq} value="4">深圳</option>
                                <option {eq name="info.ykb_selected" value="5"}selected{/eq} value="5">杭州</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">text</label>
                        <div class="layui-input-block">
                            <input type="text" name="ykb_input_text" value="{$info.ykb_input_text|default=''}" required jq-verify="" jq-error="请输入" placeholder="请输入" autocomplete="off" class="layui-input ">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">checkbox</label>
                        <div class="layui-input-block">
                            {php} $ykb_input_checkboxArray = explode(',',$info['ykb_input_checkbox']);{/php}
                            <input type="checkbox" value="1" {if condition='in_array(1,$ykb_input_checkboxArray)'}checked{/if} name="ykb_input_checkbox[1]" title="选项1">
                            <input type="checkbox" value="2" {if condition='in_array(2,$ykb_input_checkboxArray)'}checked{/if} name="ykb_input_checkbox[2]" title="选项2">
                            <input type="checkbox" value="3" {if condition='in_array(3,$ykb_input_checkboxArray)'}checked{/if} name="ykb_input_checkbox[3]" title="选项3">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">排序</label>
                        <div class="layui-input-inline">
                            <input type="number" name="sort"  jq-verify="number" value="{$info.sort|default='50'}" jq-error="排序必须为数字" placeholder="分类排序" class="layui-input ">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">单图</label>
                        <div class="layui-input-block">
                            <input type="file" name="image" class="layui-upload-file">
                            <input type="hidden" name="image" value="{$info.image|default=''}" jq-error="请上传形象图" error-id="img-error">
                            <p id="img-error" class="error"></p>
                        </div>
                        {notempty name="info.image"}
                        <div class="layui-input-block">
                            <div class="imgbox"><img src="{$info.image|default=''}" alt="..." class="img-thumbnail"></div>
                        </div>
                        {/notempty}
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">多图上传</label>
                        <div class="layui-input-block">
                            <div id="uploader" class="wu-example">
                                <div class="queueList">
                                    <div id="dndArea" class="placeholder">
                                        <div id="filePicker"></div>
                                        <p>或将照片拖到这里，单次最多可选300张</p>
                                    </div>
                                </div>
                                <div class="statusBar" style="display:none;">
                                    <div class="progress">
                                        <span class="text">0%</span>
                                        <span class="percentage"></span>
                                    </div>
                                    <div class="info"></div>
                                    <div class="btns">
                                        <div id="filePicker2"></div>
                                        <div class="uploadBtn">开始上传</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-input-block" id="webupload_hidden_img_show">
                            {php}//也可以在控制器处理数据输出
                                if(!empty($info['pics'])){
                                    $info['pics']=json_decode($info['pics'],true);
                                }
                            {/php}
                            {foreach name='info.pics' item='vo'}
                            <div style="float: left">
                                <img src="{$vo}" width="150px" class="img-thumbnail img_show">
                                <div style="text-align: center;cursor: pointer;" onclick="webupload_img_del(this)" webupload_img_del_id="{$key}" class="webupload_img_del">删除</div>
                            </div>
                            {/foreach}
                        </div>
                        <div id="webupload_hidden_input">
                            {foreach name='info.pics' item='vo'}
                            <input type="hidden" name="pics[{$key}]" value="{$vo}">
                            {/foreach}
                        </div>
                    </div>
                    <div class="layui-form-item ">
                        <label class="layui-form-label">描述</label>
                        <div class="layui-input-block">
                            <textarea name="description" placeholder="请输入" class="layui-textarea">{$info.description|default=''}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">内容</label>
                        <div class="layui-input-block">
                            <textarea name="content" class="king_content" cols="100" rows="20">{$info.content|default=''}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">日期</label>
                        <div class="layui-input-block">
                            <input name="ykb_date" value="" id="date" lay-verify="date" placeholder="发布时间" class="layui-input" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm'})" type="text">
                        </div>
                    </div>
                    <div class="layui-form-item" pane>
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="status" {eq name="info.status" value="1"}checked{/eq} title="正常" value="1" checked />
                            <input type="radio" name="status" {eq name="info.status" value="2"}checked{/eq} title="关闭" value="2" />
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <input type="hidden" name="id" value="{$info.id|default=''}">
                        <button class="layui-btn" jq-submit lay-filter="submit" jq-tab="true">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </form>
            </section>
        </div>
    </div>
</div>
</body>
{/block}
{block name="script"}
<script>
    layui.use('myform');
</script>
{/block}